import {
	defineStore
} from 'pinia'
const useUserStore = defineStore('user', () => {
	const nowid = ref(1); // 1 用户 2 师傅
	if (uni.getStorageSync('nowid')) {
		nowid.value = uni.getStorageSync('nowid');
	} else {
		uni.setStorageSync('nowid', 1)
	}

	watch(nowid, val => {
		// console.log(val,'身份id改变了身份id改变了身份id改变了身份id改变了身份id改变了身份id改变了')
		uni.setStorageSync('nowid', val)
	}, {
		immediate: true
	})

	return {
		nowid
	}



})
export default useUserStore;